package com.huan.account.controller;


import com.huan.account.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

@RestController
public class AccountController {
    @Autowired
    private AccountService accountService;

    @GetMapping("/decrease/{userId}/{money}")
    public String decrease(@PathVariable("userId") Long userId, @PathVariable("money")BigDecimal money){
        accountService.decrease(userId,money);
        return "Ok";
    }

}
